import os
import _threadfrom machine import Pinimport time LED = Pin(2, Pin.OUT) def led(dt):
    c = 0    while 1:
        c += 1        LED.value(not LED.value())        time.sleep_ms(dt)
        if c > 20:
            print('LED exit!!!')
            _thread.exit() def task(id, dt):    cnt = 0    while 1:        cnt = cnt+1        print('task%d-%d\n'%(id, cnt))        time.sleep_ms(dt)
        if cnt >20:
            print('thread '+str(id)+' exit!!!')
            _thread.exit() _thread.start_new_thread(led, (500,))_thread.start_new_thread(task, (1, 1000))_thread.start_new_thread(task, (2, 1000))
print('This is Main program,Not being affected by _thread!!')
print('The main program will run by self')